﻿@model IEnumerable<SimpleCMS.Models.News>

@{
    ViewBag.Title = "新闻列表";
}


<a class="btn btn-primary" href="/news/create"><i class="icon-shopping-cart icon-white"></i>添加新闻</a>
<br />

<table class="table table-bordered table-striped table-hover">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Time)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Title)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.EditorID)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.ClickCount)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Status)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Tags)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Genre)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Time)
                </td>
                <td>
                    @Html.ActionLink(item.Title, "Details", new { id = item.ID })
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.EditorID)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.ClickCount)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Status)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Tags)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Genre)
                </td>
                <td>
                    <div class="btn-group">
                        @Html.ActionLink("编辑", "Edit", new { id = item.ID }, new { @class = "btn btn-primary" })
                        <a class="btn btn-primary dropdown-toggle" href="#" data-toggle="dropdown"><span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li>@Html.ActionLink("编辑", "Edit", new { id = item.ID }) </li>
                            <li>@Html.ActionLink("查看", "Details", new { id = item.ID }) </li>
                            <li class="divider" />
                            <li>@Html.ActionLink("删除", "Delete", new { id = item.ID })</li>
                        </ul>
                    </div>
                </td>
            </tr>
        }
    </tbody>
</table>
